package com.jack.dao;

import java.util.List;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

import com.jack.beans.Student;

public class StudentDaoImpl extends JdbcDaoSupport implements IStudentDao {
	
	@Override
	public void insertStudent(Student student) {
		String sql="insert into student (name,age) values(?,?)";
		this.getJdbcTemplate().update(sql,student.getName(),student.getAge());
	}

	@Override
	public void deleteById(int id) {
		String sql="delete from student where id=?";
		this.getJdbcTemplate().update(sql,id);
	}

	@Override
	public void updateStudent(Student student) {
		String sql="update student set name=?,age=? where id=?";
		this.getJdbcTemplate().update(sql,student.getName(),student.getAge(),student.getId());
	}

	@Override
	public List<String> selectAllStudentsNames() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String selectStudentNameById(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<String> selectAllStudents() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Student selectStudentById(int id) {
		// TODO Auto-generated method stub
		return null;
	}

}
